<?php

namespace App\Models;

use DateTimeInterface;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

/**
 * Class MeetDay
 * *
 * @property $id  自增ID
 * @property $venue_id  场馆id
 * @property $day  日期 yyyy-mm-dd
 * @property $desc  描述
 * @property $publisher_uid  发布者uid
 * @property $created_at  
 * @property $updated_at  
 * @property $deleted_at  
 *
 * @package  App\Models
 * @mixin \Illuminate\Database\Eloquent\Builder
 */
class MeetDay extends Model 
{
    use SoftDeletes;

    protected $table = 'meet_days';

    protected $fillable = ['id', 'venue_id', 'day', 'desc', 'status', 'publisher_uid'];
    

    protected function serializeDate(DateTimeInterface $date)
    {
        return $date->format($this->dateFormat ?: 'Y-m-d H:i:s');
    }

    public function hours(){
        return $this->hasMany(MeetHour::class, 'meet_day_id');
    }
}